package com.java.s3;
import java.util.concurrent.*;
/**
 * 线程池
 */
public class Test {
    public static void main(String[] args) {
        ExecutorService executorService =new ThreadPoolExecutor(3, 5, 1L, TimeUnit.SECONDS,new ArrayBlockingQueue<>(3),
                Executors.defaultThreadFactory(),
                new ThreadPoolExecutor.AbortPolicy());
        for (int i=0 ; i<3 ; i++){
            executorService.execute(()->{
                System.out.println(Thread.currentThread().getName()+"=====>办理业务");
            });
        }
        executorService.shutdown();
    }
}
